1. Field of the Invention
The invention relates to a method and a device for reducing SATA transmission data errors, and more particularly to a method and device for reducing SATA transmission data errors by adjusting the period of sending ALIGN Primitives.
2. Description of the Related Art
The serial ATA (Serial Advanced Technology Attachment, hereinafter referred to as SATA) is an interface specification promoted by the companies of APT, Dell, IBM, Intel, Maxtor, Seagate, etc. The SATA specification is applied to the interface of a hard disk drive or an optical disk drive to replace parallel ATA/ATAPI interface that has been used for a long time. The SATA interface specification specifies two pairs of differential signal lines to replace the original 40 or 80 signal lines connected in parallel. Serializing the original data can reduce the size and voltage and increase the speed. The specification also introduces some new functions, such as flow control and error resending, to control the data stream.
FIG. 1 is a schematic illustration showing communication layers in the SATA specification. As shown in FIG. 1, the SATA interface connects a host 11 to a device 12. The device 12 may be an optical storage device or a hard disk drive, or other devices with the SATA interface. The communication layers in the SATA specification include four layers, which are respectively a first layer (physical layer), a second layer (link layer), a third layer (transport layer) and a fourth layer (application layer). The physical layer is responsible for converting digital and analog signals. That is, the physical layer receives and converts a digital signal sent from the link layer into an analog signal and sends the analog signal to the other side. The physical layer also receives and converts the analog signal, which comes from the other side, into a digital signal and outputs the digital signal to the link layer. The link layer encodes and decodes the digital data. That is, the link layer encodes the data coming from the transport layer and outputs the encoded data to the physical layer. On the other hand, the link layer decodes the data coming from the physical layer and outputs the decoded data to the transport layer. The transport layer constructs and deconstructs the FIS (Frame Information Structure). The detailed definition of the FIS can be found in the SATA specification. The application layer is in charge of buffer memory and DMA engine(s).
During the serializing process, the sending device converts the parallel data (e.g., data in bytes or words) into a serial bit data stream. In addition to the typical data, the SATA specification defines some data control codes with four bytes, which are referred to as primitives, for controlling the sending and power management of the sending device and the receiving device. For example, a X_RDY primitive (transmission data ready primitive) represents that the sending device is ready to send data, and a R_RDY primitive (receiver ready primitive) represents that the receiving device is ready to receive data.
FIG. 2 is a schematic illustration showing a packet sent through the SATA interface. Two devices communicate with each other to send the packet according to the X_RDY primitive (transmission data ready primitive) and the R_RDY primitive (receiver ready primitive). Then, the sending side sends a packet content, which is packed by a SOF primitive (start of frame) and an EOF primitive (End of frame). After the packet content is sent completely, the sending side sends a WTRM primitive (wait for frame termination primitive). If there is no any error about the CRC (Cyclic Redundancy Check) check in the link layer, the receiving side responds with a R_OK primitive (reception with no error primitive) after it receives the WTRM primitive. If there is an error about the CRC check, the receiving side responds with a R_ERR primitive (reception error).
In order to let the receiving device distinguish the beginning position of the serialized data, the SATA specification defines an ALIGN Primitive for the synchronization of the physical layer at the receiving side and for searching of the beginning bit. The sending side is specified to send at least two consecutive ALIGN Primitives within 256 double words.
However, this new interface specification still cannot impeccably process the noise interference. For example, if the received ALIGN Primitive has been polluted by noise, the physical layer may not be able to correctly find the initial bit of each double word in the following data stream such that the system receives a series of error data until the next ALIGN Primitive is correctly decoded. The malfunctioned range is proportional to the period of the appeared ALIGN Primitives.